import * as $HOST from '@/utils/host'
const host = location.origin
let $GAIA_HOST = ''
let $BASIC_PRICING_HOST = ''
if (host.indexOf('testde') > -1) {
  $GAIA_HOST = $HOST.LEGO + '/gaia/cors/inc_list_de'
  $BASIC_PRICING_HOST = $HOST.LEGO + '/gaia/cors/dynamic_pricing_de'
} else if (host.indexOf('test') > -1) {
  //Sim环境
  $GAIA_HOST = $HOST.LEGO + '/gaia/cors/inc_list_sim'
  $BASIC_PRICING_HOST = $HOST.LEGO + '/gaia/cors/dynamic_pricing_sim'
} else if (host.indexOf('testproduct') > -1) {
  // US环境
  $GAIA_HOST = $HOST.LEGO + '/gaia/cors/inc_list_us'
  $BASIC_PRICING_HOST = $HOST.LEGO + '/gaia/cors/dynamic_pricing'
} else {
  // 本地环境
  // $GAIA_HOST = $HOST.LEGO + '/gaia/cors/inc_list_us'
  $GAIA_HOST = $HOST.LEGO + '/gaia/cors/inc_list_sim'
  // $BASIC_PRICING_HOST = $HOST.LEGO + '/gaia/cors/dynamic_pricing'
  $BASIC_PRICING_HOST = $HOST.LEGO + '/gaia/cors/dynamic_pricing_sim'
}
// API接口管理字典

export const LOGIN = $HOST.BASE + '/user/login' // 登录
export const LOGOUT = $HOST.BASE + '/user/logout' // 登出
export const GET_USER_INFO = $HOST.BASE + '/user/info' // 用户信息
export const MOCK_TEST = $HOST.BASE + '/parameter/query' // mock 测试
export const GET_DEMO_IN_MODE = $HOST.BASE + '/get/demoinmode' // mock 测试
export const GET_PAGES_RESOURCE = $HOST.BASE + '/pages/resource' // 页面权限
export const GET_MENU_LIST = $HOST.BASE + '/menu/list' // 菜单列表

//公共
export const GET_ALL_COUNTRY = $HOST.LEGO + '/gaia/getAllCountry' // 获取国家下拉菜单
export const GET_CITY = $HOST.LEGO + '/gaia/getCity' // 获取城市列表
export const GET_LEGO_USER_INFO = $HOST.LEGO + '/gaia/user'
export const CHECK_GEOFENCE =
  $GAIA_HOST + '/rider-incentive/api/v2/checkFenceIds' //:POST check 电子围栏
export const GET_STRATEGY_LIST =
  $GAIA_HOST + '/rider-incentive/api/v2/strategySetList' // 策略列表
export const POST_STRATEGY_SET =
  $GAIA_HOST + '/rider-incentive/api/v2/createStrategySet' // 创建策略
// PAX
export const LEGO_GET_PRODUCT = $HOST.LEGO + '/gaia/getProduct' // 获取产品列表
export const LEGO_GET_EVENTLIST = $HOST.LEGO + '/gaia/queryEventList' // 查询活动列表
export const LEGO_GET_DATA = $HOST.LEGO + '/gaia/queryData' // 基础列表列表查询
export const LEGO_APOLLO_CONF =
  $HOST.LEGO + '/gaia/incentive/getIncentiveApolloConf' // apollo 配置数据
export const PAX_GET_EVENT_STATUS =
  $GAIA_HOST + '/rider-incentive/api/v2/get_pope_canvas_status' // 获取 活动详情 canvas_id & country_code
export const PAX_CANCEL_EVENT =
  $GAIA_HOST + '/rider-incentive/api/v2/stop_pope_canvas' // 取消活动 :POST canvas_id country_code user_name
export const PAX_EVENT_LOG_FLOW =
  $GAIA_HOST + '/rider-incentive/api/v2/get_pope_canvas_log' // :POST 获取活动状态流转 canvas_id&country_code
// multi 任务测试
export const PAX_MULTI_VALIDATE = $HOST.LEGO + '/multievent' // 乘补多任务创建 校验接口
// multi 任务正式
// export const PAX_MULTI_VALIDATE = $GAIA_HOST + '/rider-incentive/api/v2/parameterVerification' // :POST
// export const PAX_MULTI_SUBMIT =
//   $GAIA_HOST + '/rider-incentive/api/v2/batchCreateStrategySet' // :POST

//LEGO--->ICE
export const LEGO_GET_BUDGET_INFO = $HOST.LEGO + '/gaia/getBudgetInfo' // 获取预算最大值

// LEGO--->SpecialCar 特价车

export const SPECIALCAR_GET_LIST =
  $HOST.LEGO + '/gaia/cors/dynamic_pricing/economy/ui_task_list' // 获取任务列表
export const SPECIALCAR_GET_DETAIL =
  $HOST.LEGO + '/gaia/cors/dynamic_pricing/economy/get_ui_task' // 获取详细信息
export const SPECIALCAR_SUBMIT_SPARK_JOB =
  $HOST.LEGO + '/gaia/cors/dynamic_pricing/economy/submit_spark_job'
export const SPECIALCAR_GET_APOLLO_CONF =
  $HOST.LEGO + '/gaia/incentive/getIncentiveApolloConf'
export const SPECIALCAR_GET_DISCOUNTINFO = $HOST.LEGO + '/gaia/getDiscountInfo' // 获取折扣上下限

// LEGO--->EfficiencyCurve
export const EFFICIENCY_CURVE_COUNTRY =
  $HOST.LEGO + '/gaia/cors/dfare/common/countries' // EC 国家
export const EFFICIENCY_CURVE_CITY =
  $HOST.LEGO + '/gaia/cors/dfare/common/cities' // EC 城市
export const EFFICIENCY_CURVE_PRODUCT =
  $HOST.LEGO + '/gaia/cors/dfare/api/dashboard/productlines' // EC产品线
export const EFFICIENCY_CURVE_INFO =
  $HOST.LEGO + '/gaia/cors/dfare/api/dashboard/efficiencycurve' // EC详情

// LEGO--->Analyze Config 后分析配置自动化
export const ANALYZE_CONFIG_ADD = $HOST.LEGO + '/gaia/analysis/configure_add' // 新增 post
export const ANALYZE_CONFIG_LIST = $HOST.LEGO + '/gaia/analysis/configure_query' // 获取任务列表 source: dintl_ioc country_code国家码page,page_size
export const ANALYZE_CONFIG_DETAIL =
  $HOST.LEGO + '/gaia/analysis/configure_detail' // 获取任务详情 id
export const ANALYZE_CONFIG_RERUN = $HOST.LEGO + '/gaia/analysis/rerun' // 回溯 post source country_code startdate enddate
export const ANALYZE_CONFIG_RETRY =
  $HOST.LEGO + '/gaia/analysis/configure_retry' // 重试 id

// --->DFare - 公共<----
export const DFARE_LIST = $HOST.DFARE + '/dfare/set/list' //司补列表
export const DFARE_PRODUCT = $HOST.DFARE + '/dfare/common/products' // 司补event type 下拉菜单
export const DFARE_PRODUCT_NEW = $HOST.DFARE + '/dfare/common/newproducts' // 司补event type 新下拉菜单接口
export const DFARE_GET_COUNTRY = $HOST.DFARE + '/dfare/common/countries'
export const DFARE_GET_CITY = $HOST.DFARE + '/dfare/common/cities' // 司补城市获取

// --->DFare - Guidelines<----
export const GUIDELINES_GET_SELECT = $HOST.DFARE + '/dfare/jade' // 获取下拉菜单
export const GUIDELINES_CREATE_GEOFENCE = $HOST.DFARE + '/dfare/geofence/' // guidelines create geofence电子围栏id查询
export const GUIDELINES_CREATE_ECHARTS =
  $HOST.DFARE + '/dfare/jade/get_time_window' // guidelines Restriction echarts图表查询
export const GUIDELINES_CREATE_SEGMENT =
  $HOST.DFARE + '/dfare/jade/get_driver_segment' // 司机类型散点图查询
export const GUIDELINES_CREATE_SUBMIT =
  $HOST.DFARE + '/dfare/jade/guideline_configure' // 表单提交
export const GUIDELINES_REPORT = $HOST.DFARE + '/dfare/jade/detail' // Strategy Guideline Report:
export const GUIDELINES_CREATE_COMMS =
  $HOST.DFARE + '/dfare/config/comms_task/create' // create comms 创建
export const GUIDELINES_CANCEL_COMMS =
  $HOST.DFARE + '/dfare/config/comms_task/delete' // experiment_id: 2105579 cancel COMMS 删除
export const GUIDELINES_DRIVER_DOWNLOAD =
  $HOST.DFARE + '/dfare/config/download_drivers/' // guideline 详情 司机名单下载

// --->DFare - Plans<----
export const PLANS_GET_SELECT = $HOST.DFARE + '/dfare/realtime/plan' // 获取下拉菜单
export const PLANS_LIST = $HOST.DFARE + '/dfare/realtime/plan/list' // 获取列表
export const PLANS_CREAT = $HOST.DFARE + '/dfare/realtime/plan' // 活动创建
export const PLANS_MIN_DATE = $HOST.DFARE + '/dfare/realtime/plan/mindate' // 最小日期
export const PLANS_DETAIL_LIST = $HOST.DFARE + '/dfare/realtime/plan/' // 详情:id/detail
export const PLANS_TERMINAL = $HOST.DFARE + '/dfare/realtime/plan/' // 终结:id/terminat
export const PLANS_DETAIL_INFO = $HOST.DFARE + '/dfare/realtime/plan/' // 详情:id/detail
export const PLANS_SETS_INFO = $HOST.DFARE + '/dfare/realtime/plan/' // 详情:id/sets

// --->DFare - Event sets<----
export const EVENT_SETS_GET_SELECT = $HOST.DFARE + '/dfare/realtime/set' // 获取下拉菜单
export const EVENT_SETS_LIST_DETAIL = $HOST.DFARE + '/dfare/set/' // 详情:id
export const EVENT_SETS_TERMINAL = (id) => {
  return $HOST.DFARE + `/dfare/set/${id}/terminate` // 终止:id/terminate
}
export const EVENT_SETS_DOWNLOAD = $HOST.DFARE + '/dfare/set/driver/download/' // 司机列表下载:id
export const EVENT_SETS_RESULT_DOWNLOAD =
  $HOST.DFARE + '/dfare/realtime/set/download_strategy_result' // 司机策略结果下载

// --->DFare - Events<----
export const EVENT_LIST = $HOST.DFARE + '/dfare/config/list' // 获取表格
export const EVENT_DETAIL = $HOST.DFARE + '/dfare/config/' // 获取详情:id
export const EVENT_CREATE_MIS = $HOST.DFARE + '/dfare/config/' // POST 创建msi + id + "/create_mis'
export const EVENT_TERMINATE = $HOST.DFARE + '/dfare/config/' // POST 终止msi + id + "/terminate'
export const EVENT_STATUS_LIST = $HOST.DFARE + '/dfare/realtime/events' // 获取Events页面下拉菜单

// --->DFare - DashBoard<----
export const DASH_BOARD_INFO = $HOST.DFARE + '/dfare/dashboard' // 获取dashboard info
export const DASH_BOARD_LIST = $HOST.DFARE + '/dfare/incentive_reports' // 列表获取 with_detail

// --->DFare - Manual<----
export const MANUAL_EVENT_INFO = $HOST.DFARE + '/dfare/manual/list' // 获取manual 下拉菜单列表
export const MANUAL_EVENT_DETAIL = $HOST.DFARE + '/dfare/manual/' // 获取manual list :id
export const MANUAL_EVENT_LIST = $HOST.DFARE + '/dfare/api/manuals/' // 获取manual 表格

// --->City Diagnosis<----
export const CITY_PREDICTION_COUNTRY = '/gaia/city_predict/country' //获取城市预测国家列表
export const CITY_PREDICTION_CITY = '/gaia/city_predict/city' // 获取城市预测城市列表
export const CITY_PREDICTION_MODEL_VERSION = '/gaia/city_predict/version' // 获取城市预测模型列表
export const CITY_PREDICTION_LIST = $HOST.LEGO + '/gaia/city_predict/history' // 获取城市预测列表
export const CITY_PREDICTION_ECHARTS = $HOST.LEGO + '/gaia/city_predict/predict' // 获取城市预测趋势图
export const CITY_DIAGNOSIS_LIST = $HOST.LEGO + '/gaia/city_diagnosis' // 获取城市诊断列表
export const CITY_DIAGNOSIS_CHART =
  $HOST.LEGO + '/gaia/city_diagnosis/trend_chart' // 按类型查询城市诊断趋势图
export const CITY_DIAGNOSIS_CHART_HOUR =
  $HOST.LEGO + '/gaia/city_diagnosis/hour_trend_chart' // 城市诊断引擎模板(分时段查询)趋势图
export const CITY_WEEKLY_REPORT = $HOST.LEGO + '/gaia/city_diagnosis/weekly' // 获取城市诊断周报

export const CITY_SIMULATION_TREND = $HOST.LEGO + '/gaia/simulation/trend' // 仿真系统趋势图
export const CITY_SIMULATION_RADAR = $HOST.LEGO + '/gaia/simulation/radar' // 仿真系统雷达图
export const CITY_SIMULATION_EVENT_TABLE = $HOST.LEGO + '/gaia/simulation/plan' // 仿真系统 司乘补活动列表

// --->Online Feedback<----

// ---> Common <---
export const ONLINE_FEEDBACK_PROJECT_LIST =
  $HOST.LEGO + '/dintl_driver_spark/projects' // 获取项目列表
export const ONLINE_FEEDBACK_PROJECT_VERSION_LIST =
  $HOST.LEGO + '/dintl_driver_spark/getStrategyListByProjectName' // 获取项目版本号

// ---> Flink <---
export const ONLINE_FEEDBACK_FLINK_LIST =
  $HOST.LEGO + '/dintl_driver_spark/getFlinkList' // 获取Flink列表 :GET
export const ONLINE_FEEDBACK_FLINK_SUBMIT =
  $HOST.LEGO + '/dintl_driver_spark/submitPyFlinkTask' // 新增flink 任务 :POST
export const ONLINE_FEEDBACK_FLINK_RESTART =
  $HOST.LEGO + '/dintl_driver_spark/restartTasks' // flink任务批量重启 :POST
export const ONLINE_FEEDBACK_FLINK_BUSINESS_TIMEOUT_CHANGE =
  $HOST.LEGO + '/dintl_driver_spark/updateTasksTimeOut' // flink任务批量修改business timeout :POST
export const ONLINE_FEEDBACK_FLINK_TERMINAL =
  $HOST.LEGO + '/dintl_driver_spark/stopTasks' // flink任务批量终止 : POST
export const ONLINE_FEEDBACK_FLINK_SWITCH =
  $HOST.LEGO + '/dintl_driver_spark/switchFlinkIfNeedSink' // 任务批量flink开关转换
export const ONLINE_FEEDBACK_FLINK_SINK =
  $HOST.LEGO + '/dintl_driver_spark/oneSwitchFlinkIfNeedSink' // job_ids : POST
export const ONLINE_FEEDBACK_CITY_TABLE =
  $HOST.LEGO + '/dintl_driver_spark/getFlinkCityByCondition' // :POST  "job_id":123, 获取城市级的表格数据
export const ONLINE_FEEDBACK_CITY_MULTI_SINK_SWITCH =
  $HOST.LEGO + '/dintl_driver_spark/switchCityIfNeedSink' //:POST post_data:[id, id, id] (Array) 多城市sink任务切换
export const ONLINE_FEEDBACK_CITY_SINGLE_SINK_SWITCH =
  $HOST.LEGO + '/dintl_driver_spark/oneSwitchCityIfNeedSink' // :GET "new_flink_sink_id":123,"old_flink_sink_id":456 单城市sink切换

// ---> Spark <---
export const ONLINE_FEEDBACK_SPARK_LIST =
  $HOST.LEGO + '/dintl_driver_spark/getSparkList' // 获取spark列表: GET
export const ONLINE_FEEDBACK_SPARK_SUBMIT =
  $HOST.LEGO + '/dintl_driver_spark/submitPySparkTask' // 提交spark任务: POST
export const ONLINE_FEEDBACK_SPARK_RESTART =
  $HOST.LEGO + '/dintl_driver_spark/restartTasks' // spark任务批量重启 :POST  "job_type":"spark",
export const ONLINE_FEEDBACK_SPARK_TERMINAL =
  $HOST.LEGO + '/dintl_driver_spark/stopTasks' // spark任务批量终止 : POST "job_type":"spark",

// ---> 特征中心 Feature Center <---
// ---> 公共 Feature Center <---
export const FEATURE_DIMENSIONS =
  $HOST.LEGO + '/astro/feature_center/register/dimensions' // 特征维度 :GET
export const FEATURE_DATA_BASE =
  $HOST.LEGO + '/astro/feature_center/database/db' // 特征注册向导模式 数据库列表获取
export const FEATURE_HIVE_TABLE = (dataBase) => {
  return $HOST.LEGO + `/astro/feature_center/database/db/${dataBase}/table` // 特征注册 HIVE Table 获取
}
// ---> 离线特征注册页面 Feature Register <---
export const OFFLINE_FEATURE_SUBMIT =
  $HOST.LEGO + '/astro/feature_center/register' // 特征注册提交 :POST
export const FEATURE_SUBMIT_HQL_PARSE =
  $HOST.LEGO + '/astro/feature_center/database/sql/parse' // HQL解析 :POST statement
export const FEATURE_SUBMIT_PY_PARSE =
  $HOST.LEGO + '/astro/feature_center/py/parse' // PY解析 :POST statement
export const FEATURE_SUBMIT_PRIMARY_KEY =
  $HOST.LEGO + '/astro/feature_center/register/primary_keys' // 特征注册 主键列表获取 :GET
export const FEATURE_GUIDE_PARSE = (dataBase, tableName) => {
  return (
    $HOST.LEGO +
    `/astro/feature_center/database/db/${dataBase}/table/${tableName}/columns` // 向导模式特征解析:GET
  )
}
export const FEATURE_SUBMIT_FETCH = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}` // 特征查询（特征回显）:GET
}
export const FEATURE_TRAIL_RUN_DATA = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/table_sample` // 特征试运行数据查询
}
export const FEATURE_EDIT_CNAME = (id) => {
  return $HOST.LEGO + `/astro/feature_center/features/${id}/cname` // 修改特征名称:POST
}
export const FEATURE_EDIT_DESC = (id) => {
  return $HOST.LEGO + `/astro/feature_center/features/${id}/desc` // 修改特征备注:POST
}

// ---> 实时特征注册页面 Online Feature Register <---
export const RT_FEATURE_DEFAULT_PARAMS =
  $HOST.LEGO + '/astro/feature_center/flink/taskDefaultParams' // 获取实时任务默认参数
export const RT_FEATURE_SAMPLE_SQL =
  $HOST.LEGO + '/astro/feature_center/flink/sql/sample' // 获取实时特征SQL参数
export const RT_FEATURE_ANALYZE =
  $HOST.LEGO + '/astro/feature_center/flink/sql/parse' //:POST // 实时特征解析 参数sql
export const RT_FEATURE_REGISTER_SUBMIT =
  $HOST.LEGO + '/astro/feature_center/register' // :POST // 实时特征任务提交

// 实时特征 Kafka配置项
export const RT_FEATURE_KAFKA_DEFAULT_CONFIG =
  $HOST.LEGO + '/astro/feature_center/kafka/configs' // :GET Kafka配置接口
export const RT_FEATURE_KAFKA_SQL =
  $HOST.LEGO + '/astro/feature_center/kafka/generateSourceSql' // :POST 获取kafka sql
export const RT_FEATURE_KAFKA_CLUSTER =
  $HOST.LEGO + '/astro/feature_center/kafka/clusters' // :GET 获取集群信息
export const RT_FEATURE_KAFKA_TOPIC =
  $HOST.LEGO + '/astro/feature_center/kafka/topics' // :GET 获取topic

// 实时特征 注册任务管理接口
export const RT_FEATURE_START = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/flink/start` // :POST 任务启动接口
}
export const RT_FEATURE_RESTART = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/flink/restart` // :POST 任务重启接口
}
export const RT_FEATURE_STOP = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/flink/stop` // :POST 任务停止接口
}
export const RT_FEATURE_DEL = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/flink/del` // :POST 任务删除接口
}
export const RT_CHECKPOINT_STAMP = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/flink/saveState` // 获取最近启动时间 - 准备注释
}
export const RT_TRAIL_RUN_DATA = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/flink/trialRunData` // :GET 获取试运行数据 type 1 fusion (实时) 2 hive (离线)
}

// ---> 特征管理(上下线) Feature Manager <---
export const FEATURE_MANAGER_LIST =
  $HOST.LEGO + '/astro/feature_center/features' // 特征管理列表 :GET
export const FEATURE_ONLINE_VALUE = (id) => {
  return $HOST.LEGO + `/astro/feature_center/features/${id}/online` // 特征查询线上值:POST
}
export const FEATURE_RELEASE =
  $HOST.LEGO + '/astro/feature_center/features/release' // 特征发布提交:POST
export const FEATURE_RELEASE_KEY = (id) => {
  return $HOST.LEGO + `/astro/feature_center/features/${id}/keys` // 获取特征上线值key:GET
}
export const FEATURE_DETAIL = (id) => {
  return $HOST.LEGO + `/astro/feature_center/features/${id}` // 查询特征详情:GET
}
export const SQL_GENERATE =
  $HOST.LEGO + '/astro/feature_center/features/generate_sql' // 一键生成sql:POST
// ---> 特征任务管理 Feature Manager <---
export const FEATURE_SUBMIT_TASK_LIST =
  $HOST.LEGO + '/astro/feature_center/registers' // 注册任务列表：GET
export const FEATURE_PUBLIC_TASK_LIST =
  $HOST.LEGO + '/astro/feature_center/releases' // 发布任务列表：GET
export const FEATURE_VARS = $HOST.LEGO + '/astro/feature_center/register/vars' // 变量列表 :GET
export const FEATURE_RERUN_DETAIL = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/backs` // 回溯任务列表 ：GET
}
export const FEATURE_SUBMIT_RERUN = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/back` // 注册任务数据回溯:POST
}
export const FEATURE_SUBMIT_CANCEL = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/cancel` // 注册任务取消：GET
}
export const FEATURE_VERSION_LIST = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/versions` // 注册任务版本列表：GET
}
export const FEATURE_VERSION_SAVE = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/version` // 注册任务修改版本
}
export const FEATURE_PUBLIC_DETAIL = (id) => {
  return $HOST.LEGO + `/astro/feature_center/releases/${id}` // 发布任务详情
}
export const FEATURE_PUBLIC_CANCEL = (id) => {
  return $HOST.LEGO + `/astro/feature_center/releases/${id}/cancel` // 发布任务取消
}
export const FEATURE_PUBLIC_AUDIT = (id) => {
  return $HOST.LEGO + `/astro/feature_center/releases/${id}/audit` // 发布任务审核
}
export const FEATURE_SUBMIT_AUDIT = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/audit` // 注册任务审核
}
export const FEATURE_SUBMIT_MULTI_VERSION_SWITCH = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/mulVersionSwitch` // 特征 开启/关闭 多版本
}
export const FEATURE_TASK_STATUS_SWITCH = (id) => {
  return $HOST.LEGO + `/astro/feature_center/registers/${id}/enableStatusSwitch` //:POST 特征停用启用 enable: 0 停用 1 启用 reason 操作理由
}
// 事务组管理
export const FEATURE_GROUP_SUBMIT = $HOST.LEGO + '/astro/feature_center/group' // post事务组提交
export const FEATURE_GROUP_LIST = $HOST.LEGO + '/astro/feature_center/groups' // get事务组列表
export const FEATURE_GROUP_DETAIL = (id) => {
  return $HOST.LEGO + `/astro/feature_center/groups/${id}` // get事务组详情
}

export const FEATURE_GROUP_VERSION_SWITCH = (id) => {
  return $HOST.LEGO + `/astro/feature_center/groups/${id}/version` // post事务组版本切换
}
export const FEATURE_GROUP_DELETE = (id) => {
  return $HOST.LEGO + `/astro/feature_center/groups/${id}/delete` // post事务组删除
}
export const FEATURE_GROUP_TASK_NAME_LIST =
  $HOST.LEGO + '/astro/feature_center/registers/names' // get任务名称列表
export const FEATURE_GROUP_TASK_VERSION_LIST =
  $HOST.LEGO + '/astro/feature_center/groups/versions' // get版本列表

/// <--------------------Basic Pricing 基础定价-------------------->
export const BASIC_PRICING_PAGE_TABLE =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/getStrategyList' // :POST 策略创建表格 witch_page generator 系数策略表格 coefficient
export const BASIC_PRICING_VIEW =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/getStrategyInfoById' // 根据ID查询基本信息详情
export const BASIC_PRICING_GEOFENCE_LIST =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/getGeofenceListByCityId' // :POST 策略电子围栏列表 city_id
export const BASIC_PRICING_CONFIRM =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/getBasicLine' //:POST 策略创建页面confirm按钮 策略基线数据获取
export const BASIC_PRICING_SUBMIT =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/save' // :POST 基本信息保存
export const BASIC_PRICING_CONFLICT =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/getConflictStrategyByCityId' // :GET 获取冲突
export const BASIC_PRICING_APPLY =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/apply' // :GET 策略应用
export const BASIC_PRICING_APPROVE =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/approval' // :POST if_pass: true false
export const BASIC_PRICING_CANCEL =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/terminate' // :GET 取消申请(未上线生效)
export const BASIC_PRICING_TERMINATE =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/rollback' // :GET 开发人员策略终止
export const BASIC_PRICING_RUN_NEW_RESULT =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/editAgain' // :POST 运行策略新结果
export const BASIC_PRICING_ONLINE_VERSION =
  $BASIC_PRICING_HOST + '/dintl_pricing/v1/strategy/getCurrentStrategyByCityId' // :GET 获取当前城市生效版本

// <--------------------模型中心-------------------->
// <--------------------模型注册-------------------->
export const MODULE_MANAGE_REGISTER_LIST =
  $HOST.LEGO + '/astro/model_center/registers' // :GET 注册任务列表
export const MODULE_MANAGE_REGISTER =
  $HOST.LEGO + '/astro/model_center/register' // :POST 模型注册
export const MODULE_MANAGE_PROJECT_LIST =
  $HOST.LEGO + '/astro/model_center/registers/projectList' // :GET 项目列表获取
export const MODULE_MANAGE_EDIT_INFO = (id) => {
  return $HOST.LEGO + `/astro/model_center/registers/${id}` // 注册模型查询
}
// <--------------------模型管理-------------------->
export const MODULE_LIST_OLD = $HOST.LEGO + '/astro/model_center/models' // 老模型列表
export const MODULE_MANAGE_LIST = (id) => {
  return $HOST.LEGO + `/astro/model_center/models/${id}/versions` // :GET 模型列表获取
}
export const MODULE_MANAGE_VERSION_DETAIL = (id, versionId) => {
  return $HOST.LEGO + `/astro/model_center/models/${id}/versions/${versionId}` // :GET 模型版本详情 testCase数据显示
}
export const MODULE_MANAGE_TYPE = $HOST.LEGO + '/astro/model_center/model/types' // :GET 模型类型获取
export const MODULE_MANAGE_VERSION_CHANGE =
  $HOST.LEGO + '/astro/model_center/models/upload'
export const MODULE_MANAGE_VERSION_LIST = (id, type) => {
  return $HOST.LEGO + `/astro/model_center/models/${id}/${type}/versions`
}
export const MODULE_MANAGE_VERSION_SWITCH = (id) => {
  return $HOST.LEGO + `/astro/model_center/models/${id}/version` // 模型版本切换
}
export const MODULE_MANAGE_STATUS_SWITCH = (id) => {
  return $HOST.LEGO + `/astro/model_center/models/versions/${id}` // :POST 模型状态开关
}
export const MODULE_MANAGE_TEST = (id) => {
  return $HOST.LEGO + `/astro/model_center/models/versions/${id}/test` // :POST 模型测试
}
export const MODULE_MANAGE_DELAY = (id) => {
  return $HOST.LEGO + `/astro/model_center/models/versions/${id}/delay_alarm` // :POST 模型延迟同志
}
export const MODULE_MANAGE_TOKEN = '/astro/model_center/models/token' // :GET 获取 模型管理token

// <--------------------操作日志-------------------->
export const OPERATION_LOG_LIST = $HOST.LEGO + '/astro/opt_logs' // :GET 获取 操作日志列表
export const OPERATION_LOG_OPT = $HOST.LEGO + '/astro/opt_log/confs' // :GET 获取 操作日志 配置

// <--------------------Pipeline-------------------->
export const PIPELINE_GET_COMPONENTS = $HOST.LEGO + '/pipeline/components' // 获取stencil
export const PIPELINE_TABLE_LIST =
  $HOST.LEGO + '/astro/feature_center/database/table/search' // 获取module pipeline列表
export const PIPELINE_SCHEME_LIST = $HOST.LEGO + '/astro/pipeline/dags/scheme'
export const PIPELINE_DAG_SAVE = $HOST.LEGO + '/astro/pipeline/dag'
export const PIPELINE_DAG_RUN = (id) => {
  // id: dag id
  return $HOST.LEGO + `/astro/pipeline/dags/${id}/run`
  //runType: '', // start  开始,  stop 停止， startFrom， 从某个节点开始, retry 重新跑某个节点，runTo 运行到某个节点
}
export const PIPELINE_DAG_STATUS = (id) => {
  // 获取dag所有节点状态
  return $HOST.LEGO + `/astro/pipeline/dags/${id}/status`
}
export const PIPELINE_DAG_RUN_REPORT = (id) => {
  // 查看节点日志
  return $HOST.LEGO + `/astro/pipeline/dags/${id}/logs`
}
export const PIPELINE_TABLE = '/astro/pipeline/dags'
export const PIPELINE_DAG_DATA = (id) => {
  // 获取dag信息
  return $HOST.LEGO + `/astro/pipeline/dags/${id}`
}
export const PIPELINE_NODE_RESULT = (id) => {
  return $HOST.LEGO + `/astro/pipeline/dags/${id}/outputs` // 查询节点输出结果信息
}
